<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

    
    <xsl:template match="/">
      <results>
          <xsl:for-each select="//book/title[not(. = ./preceding::title)]">
              <xsl:variable name="min-price">
                  <xsl:call-template name="math:min">
                      <xsl:with-param name="nodes" select="//book[title=current()]/price"/>
                  </xsl:call-template>
                  
              </xsl:variable>
              <minprice title="{.}">
                  <price><xsl:value-of select="$min-price"/></price>
              </minprice>
          </xsl:for-each>
      </results>
    </xsl:template>
</xsl:stylesheet>